Skip to content

Do not keep task id reference indefinitely in Celery instrumenation #3690

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rbagd
Copy link
Contributor

@rbagd rbagd commented Aug 13, 2025

Description

Reference to a task identifier as a string is kept indefinitely by the instrumentation. This just makes sure it gets removed once no longer needed.

Related #3458

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Unit test to ensure reference is not there

Does This PR Require a Core Repo Change?

  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@rbagd rbagd changed the title Do not keep task id reference indefinitely Do not keep task id reference indefinitely in Celery instrumenation Aug 13, 2025
@rbagd rbagd requested a review from a team as a code owner August 13, 2025 08:18
@@ -42,6 +42,8 @@ def test_basic_metric(self):
task_runtime_estimated = (default_timer() - start_time) * 1000

metrics = self.get_metrics()
self.assertEqual(CeleryInstrumentor().task_id_to_start_time, {})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should another test be added where the task_id does not exist and the pop operation returns None instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants